import java.util.Random;

/*
 *  Simple Class used for learning SVN
 */

public class Main {


  	/*! \brief Main method which calls our operations in specific order.
	 * \param args Paramaters from console  */
	public static void main(String[] args) {
		System.out.println("Hello Group 8!");
		int x=-3;
		x=AhmetErdem(x);
		x=NazireAslan(x);
		x=TalhaKaya(x);
		x=BuketNazlican(x);
		x=SerkanOzer(x);
		x=AhmetCelik(x);
		x=BerkeCanGurer(x);
		x=KivancUnal(x);
		x=AhmadZafar(x);
		System.out.println("Our generated number is "+x);
	}
	
	/*! \brief Basic number generator 
	 * \param x integer input number
	 * \return an integer generated from input by basic calculations*/
	public static int AhmetErdem(int x){
		x=x*x-1;
		x=x%6;
		return x;
	}
	
  /*! \brief Transform an integer depending its mood.
   *  \param x integer input number
   *  \return an integer x-4 or x+7
   *    If x is too small or too large, addition or substraction ignored.*/ 
	public static int AhmetCelik(int x){
    if(x>=(Integer.MAX_VALUE-7)) 
      return Integer.MAX_VALUE;
    else if(x<=(Integer.MIN_VALUE+4)) 
       return Integer.MIN_VALUE;
		x += ( (new Random()).nextInt(77) > 33) ? -4 : 7;
		return x;
	}
	public static int BuketNazlican(int x){
		
		if( Math.abs(x) % 2 == 1)
			x = x * 3 + 1;
		else
			x = x/2;
		
		return x;
	}
	public static int BerkeCanGurer(int x){
		return x;
	}
	/*! \brief Change an integer depending on the comparison to 7
	   *  \param x integer input number
	   *  \return an integer with delightful behaviour */ 
	public static int NazireAslan(int x){
		if(x > 7)
		{
			x=7;
		}
		else
		{
			x=TalhaKaya(x);
		}
		
		return x;
	}
	/*! \brief Select a char from 'pudding'
	   *  \param x integer input number
	   *  \return an integer transformed from a char 'pudding' */ 
	public static int TalhaKaya(int x){
		double y = x / 10.0;
		if (y < 1.0 / 7)
		{
			x = (int) 'p';
		}
		else if (y < 2.0 / 7)
		{
			x = (int) 'u';
		}
		else if (y < 3.0 / 7)
		{
			x = (int) 'd';
		}
		else if (y < 4.0 / 7)
		{
			x = (int) 'd';
		}
		else if (y < 5.0 / 7)
		{
			x = (int) 'i';
		}
		else if (y < 6.0 / 7)
		{
			x = (int) 'n';
		}
		else
		{
			x = (int) 'g';
		}
		
		return x;
	}
	/*! \brief Returns next larger power of 2 of a number.
	 * \param x integer input number
	 * \return next larger power of 2 of x */
	public static int SerkanOzer(int x){
		x=(int) Math.pow(2,Math.ceil(Math.log(x)/Math.log(2)));
		return x;
	}
	public static int KivancUnal(int x){
		return x;
	}
	public static int AhmadZafar(int x){

		int fibonacci = 0;
		int num1 = 0;
		int num2 = 1;
		
		if (x >= 50)
		{
			return 0;
		}
		else
		{	
			for (int loop = 0; loop < x; loop ++)
			{
				fibonacci = num1 + num2;
				num1 = num2;
				num2 = fibonacci;
			}
		}
		return num2;
	}

}
